<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="d" uri="http://dgg.net/jsp/jstl/core" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<input type="hidden" id="currentId" value="${productOrder.id}"><%--主订单id--%>
<input type="hidden" id="businessProductCode" value="${productOrder.businessProductCode}"><%--业态code--%>
<%--新增办理渠道--%>
<div class="dialog-warp-ajax">
    <table class="dggui-table-info">
        <tbody>
        <tr>
            <th><span class="required">业务类型：</span></th>
            <td>
                <span >${productOrder.businessProductName}</span>
            </td>
        </tr>
        <tr>
            <th><span class="required">产品：</span></th>
            <td>
                <input type="hidden" name="currentProductId" id="currentProductId" value="${productOrder.productId}"/>
                <span >${productOrder.productName}</span>

            </td>
        </tr>
        <tr>
            <th><span class="required">商品属性：</span></th>
            <td>
                <input type="hidden" name="currentProductId" id="currentGoodsId" value="${productOrder.goodsId}"/>
                <span >${productOrder.goodsName}</span>
            </td>
        </tr>
        <tr>
            <th><span class="required">渠道：</span></th>
            <td id="channelTip">
                <select class="dggui-select" name="channel" id="channel">
                    <option value="">请选择</option>
                </select>
            </td>
        </tr>
        <tr>
            <th><span class="required">流程人员：</span></th>
            <td id="addFlowUserTip">
                <select class="dggui-select" name="addFlowUserId" id="addFlowUserId">
                    <option value="">请选择</option>
                </select>
            </td>
        </tr>
        <tr>
            <th>支行：</th>
            <td>
                <input type="text" name="channelSubBranch" maxlength="50" id="channelSubBranch" class="dggui-input"/>
            </td>
        </tr>
        <tr>
            <th>服务合同编号：</th>
            <td>
                <input type="text" disabled="true" name="contractNo" id="contractNo" value="${productOrder.contractNo}"
                       class="dggui-input"/>
            </td>
        </tr>
        <tr>
            <th><span class="required">需求金额：</span></th>
            <td>
                <div class="unit-warp">
                    <input type="text" name="money" oninput="calcContractMoneyF(this,12);" maxlength="12" id="money" value="" class="dggui-input"/>
                    <span class="unit">元</span>
                </div>
            </td>
        </tr>

        </tbody>
    </table>
</div>


<script type="text/javascript">

    $(function () {

        $(document).ready(function () {
            dggui.use(['select2', 'distpicker'], function () {
                var select2 = dggui.select2;
                var distpicker = dggui.distpicker;

                //初始化流程人员
                var productId = $("#currentProductId").val();///产品id
                var productName = $("#currentProductName").text();///产品名称

                $("#channel").find("option").remove();
                $("#channel").append("<option value=''>请选择</option>");
                $.post(sysInfo.basePath + '/rzsc/processing_order/channel_by_proid.do', {id: productId}, function (result) {
                    if (result.code == 0) {
                        $.each(result.data, function (i, item) {
                            $("#channel").append("<option value='" + item.id + "'>" + item.name + "</option>");
                        });
                    } else {
                        dggui.dialog.warning("产品" + productName + ",未查询到渠道");
                    }
                });

                select2.render({
                    placeholder: "请选择",
                    allowClear: true,//清空选中
                    elem: $('#channel'),
                    width: "280px",
                    multiple: false,// 单选false或不写该参数，多选true
                });


                //初始化流程人员
                initUser("RZSC_FLOW_USER", "division", "#addFlowUserId");
                select2.render({
                    placeholder: "请选择",
                    allowClear: true,
                    elem: $('#addFlowUserId'),
                    width: "280px"
                });

            });
        });

    });


</script>

